import request from '@/utils/request'
// import { method } from 'lodash'

// 获取车辆分页列表
export function getPagecarList(params) {
  return request({
    url: '/manager/truck/page',
    method: 'get',
    params
  })
}
// 添加车辆
export function addCarList(data) {
  return request({
    url: '/manager/truck',
    method: 'post',
    data
  })
}
// 获取车辆详情
export function getDetails(id) {
  return request({
    url: `/manager/truck/${id}`

  })
}
// 上传图片
export function imageUpload(data) {
  return request({
    url: '/manager/files/imageUpload',
    method: 'post',
    data
  })
}
// 更新车辆
export function updateDetails(id, data) {
  return request({
    url: `/manager/truck/${id}`,
    method: 'put',
    data
  })
}
// 获取司机
export function getDrivers(truckId) {
  return request({
    url: `/manager/bindingDrivers/${truckId}`

  })
}
// 获取司机
export function getunBindingDrivers() {
  return request({
    url: `/manager/unBindingDrivers/`

  })
}
// 车辆绑定司机
export function truckDrivers(data) {
  return request({
    url: '/manager/truck/truckDrivers',
    method: 'post',
    data
  })
}
// 获取司机详情
export function getDriversDetails(id) {
  return request({
    url: `/manager/bindingDrivers/${id}`

  })
}
// 启用
export function Enable(id) {
  return request({
    url: `/manager/enable/${id}`,
    method: 'put'

  })
}
// 禁用
export function Disable(id) {
  return request({
    url: `/manager/disable/${id}`,
    method: 'put'

  })
}
